package bairui.international.model.type;

/**
 *
 * (产品订单项类型)Type_ProductOrderItem
 */
@com.lianjing.sh.processing.info.annotation.GenerateInfoModel
@com.lianjing.sh.model.common.annotation.Comment("产品订单项类型")
@com.lianjing.sh.processing.info.annotation.InfoComment("产品订单项类型")
public enum Type_ProductOrderItem implements com.sh_lianjing.standard.EnumCommentable<Type_ProductOrderItem> {

	/**
	 * (商品)Product</br>
	 */
	@com.lianjing.sh.model.common.annotation.Comment("商品")
	@com.lianjing.sh.processing.info.annotation.InfoComment("商品")
	Product("商品")
,
	/**
	 * (包装)Pack</br>
	 */
	@com.lianjing.sh.model.common.annotation.Comment("包装")
	@com.lianjing.sh.processing.info.annotation.InfoComment("包装")
	Pack("包装")
,
	/**
	 * (积分兑换)Grade</br>
	 */
	@com.lianjing.sh.model.common.annotation.Comment("积分兑换")
	@com.lianjing.sh.processing.info.annotation.InfoComment("积分兑换")
	Grade("积分兑换")
;

	private static java.util.Map<String, Type_ProductOrderItem> Cache = new java.util.HashMap<>();
	static{
		for(Type_ProductOrderItem enumItem : Type_ProductOrderItem.values()){
			Cache.put(enumItem.getComment(), enumItem);
		}
	}

	private String comment;

	private Type_ProductOrderItem(String comment){
		this.comment = comment;
	}

	@Override
	public String toString() {
		return comment;
	}

	@Override
	public String getComment() {
		return comment;
	}

	@Override
	public Type_ProductOrderItem parseByComment(String comment) {
		return Type_ProductOrderItem.parse(comment);
	}

	public static Type_ProductOrderItem parse(String comment) {
		Type_ProductOrderItem enumItem = Cache.get(comment);
		if(null == enumItem){
			 throw new com.sh_lianjing.standard.exception.EnumCommentableException(Type_ProductOrderItem.class, comment);
		}
		return enumItem;
	}

}
